/**
 * 第二周作业3
 * zlp
 */
class PrintChar {
  constructor(str,height) {
    this.str = str;
    this.height = height;
    // this.ChangeData = function (str,height){
    //   this.str = str;
    //   this.height = height;
    // }
  }
  //正三角
  for1(){
    for (let i = 0;i < this.height; i++){
      var result = "";
      for(let j = 0;j<=i;j++){
        result += this.str;
      }
    console.log(result);
    }
  }
  //倒三角
  for2(){
    for (let i = this.height;i > 0;i--){
      var result = "";
      for (let j = 0;j<i;j++){
        result += this.str;
      }
      console.log(result);
    }
  }
}
var  p = new PrintChar("A", 10);
p.for1();
p.for2();
